#include "label.h"

#include <QDebug>
#include <QMouseEvent>

Label::Label(QWidget* parent)
    :QLabel(parent)
{

}

void Label::mousePressEvent(QMouseEvent *event)
{
    //当前event对象就包含了鼠标点击位置的坐标
    qDebug()<<event->x()<<","<<event->y();
    //globalX是以屏幕左上角为原点，获取坐标
}
